package com.maogouxiong.seatatestaccount.account.controller;


import com.maogouxiong.seatatestaccount.account.entity.Account;
import com.maogouxiong.seatatestaccount.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author maogouxiong
 * @since 2020-06-19
 */
@RestController
@RequestMapping("/account/account")
public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping(value = "/reduceBalance")
    public void reduceBalance(String userId, int money) {

        Account account = new Account();
        account.setMoney(money);
        account.setUserId(userId);

        accountService.reduceBalance(account);

    }

}
